home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / oper_sys / mach / amiga / tools / gcc040p1.lha / as.info-3 < prev    next >
Encoding:
GNU Info File  |  1993-03-09  |  45.6 KB  |  1,269 lines

  1. This is Info file as.info, produced by Makeinfo-1.52 from the input
  2. file ../../../gas/doc/as-all.texinfo.
  3.  
  4. START-INFO-DIR-ENTRY
  5. * As: (as).                     The GNU assembler.
  6. END-INFO-DIR-ENTRY
  7.  
  8.    This file documents the GNU Assembler "as".
  9.  
  10.    Copyright (C) 1991, 1992 Free Software Foundation, Inc.
  11.  
  12.    Permission is granted to make and distribute verbatim copies of this
  13. manual provided the copyright notice and this permission notice are
  14. preserved on all copies.
  15.  
  16.    Permission is granted to copy and distribute modified versions of
  17. this manual under the conditions for verbatim copying, provided also
  18. that the section entitled "GNU General Public License" is included
  19. exactly as in the original, and provided that the entire resulting
  20. derived work is distributed under the terms of a permission notice
  21. identical to this one.
  22.  
  23.    Permission is granted to copy and distribute translations of this
  24. manual into another language, under the above conditions for modified
  25. versions, except that the section entitled "GNU General Public License"
  26. may be included in a translation approved by the Free Software
  27. Foundation instead of in the original English.
  28.  
  29. 
  30. File: as.info,  Node: H8/300-Chars,  Next: H8/300-Regs,  Up: H8/300 Syntax
  31.  
  32. Special Characters
  33. ..................
  34.  
  35.    `;' is the line comment character.
  36.  
  37.    `$' can be used instead of a newline to separate statements.
  38. Therefore *you may not use `$' in symbol names* on the H8/300.
  39.  
  40. 
  41. File: as.info,  Node: H8/300-Regs,  Next: H8/300-Addressing,  Prev: H8/300-Chars,  Up: H8/300 Syntax
  42.  
  43. Register Names
  44. ..............
  45.  
  46.    You can use predefined symbols of the form `rNh' and `rNl' to refer
  47. to the H8/300 registers as sixteen 8-bit general-purpose registers.  N
  48. is a digit from `0' to `7'); for instance, both `r0h' and `r7l' are
  49. valid register names.
  50.  
  51.    You can also use the eight predefined symbols `rN' to refer to the
  52. H8/300 registers as 16-bit registers (you must use this form for
  53. addressing).
  54.  
  55.    The two control registers are called `pc' (program counter; a 16-bit
  56. register) and `ccr' (condition code register; an 8-bit register).  
  57. `r7' is used as the stack pointer, and can also be called `sp'.
  58.  
  59. 
  60. File: as.info,  Node: H8/300-Addressing,  Prev: H8/300-Regs,  Up: H8/300 Syntax
  61.  
  62. Addressing Modes
  63. ................
  64.  
  65.    as understands the following addressing modes for the H8/300:
  66. `rN'
  67.      Register direct
  68.  
  69. `@rN'
  70.      Register indirect
  71.  
  72. `@(D, rN)'
  73. `@(D:16, rN)'
  74.      Register indirect: 16-bit displacement D from register N. (You may
  75.      specify the `:16' for clarity if you wish, but it is not required
  76.      and has no effect.)
  77.  
  78. `@rN+'
  79.      Register indirect with post-increment
  80.  
  81. `@-rN'
  82.      Register indirect with pre-decrement
  83.  
  84. ``@'AA'
  85. ``@'AA:8'
  86. ``@'AA:16'
  87.      Absolute address `aa'.  You may specify the `:8' or `:16' for
  88.      clarity, if you wish; but `as' neither requires this nor uses
  89.      it--the address size required is taken from context.
  90.  
  91. `#XX'
  92. `#XX:8'
  93. `#XX:16'
  94.      Immediate data XX.  You may specify the `:8' or `:16' for clarity,
  95.      if you wish; but `as' neither requires this nor uses it--the data
  96.      size required is taken from context.
  97.  
  98. ``@'`@'AA'
  99. ``@'`@'AA:8'
  100.      Memory indirect.  You may specify the `:8' for clarity, if you
  101.      wish; but `as' neither requires this nor uses it.
  102.  
  103. 
  104. File: as.info,  Node: H8/300 Floating Point,  Next: H8/300 Directives,  Prev: H8/300 Syntax,  Up: H8/300-Dependent
  105.  
  106. Floating Point
  107. --------------
  108.  
  109.    The H8/300 family uses IEEE floating-point numbers.
  110.  
  111. 
  112. File: as.info,  Node: H8/300 Directives,  Next: H8/300 Opcodes,  Prev: H8/300 Floating Point,  Up: H8/300-Dependent
  113.  
  114. H8/300 Machine Directives
  115. -------------------------
  116.  
  117.    `as' has no machine-dependent directives for the H8/300. However, on
  118. this platform the `.int' and `.word' directives generate 16-bit numbers.
  119.  
  120. 
  121. File: as.info,  Node: H8/300 Opcodes,  Prev: H8/300 Directives,  Up: H8/300-Dependent
  122.  
  123. Opcodes
  124. -------
  125.  
  126.    For detailed information on the H8/300 machine instruction set, see
  127. `H8/300 Series Programming Manual' (Hitachi ADE--602--025).
  128.  
  129.    `as' implements all the standard H8/300 opcodes.  No additional
  130. pseudo-instructions are needed on this family.
  131.  
  132.    The following table summarizes the opcodes and their arguments:
  133.  
  134.      Rs   source register
  135.                  Rd   destination register
  136.                  imm  immediate data
  137.                  x:3  a bit (as a number between 0 and 7)
  138.                  d:8  eight bit displacement from `pc'
  139.                  d:16 sixteen bit displacement from `Rs'
  140.      
  141.      add.b   Rs,Rd                  biand   #x:3,Rd
  142.      add.b   #imm:8,Rd              biand   #x:3,@Rd
  143.      add.w   Rs,Rd                  biand   #x:3,@aa:8
  144.      adds    #1,Rd                  bild    #x:3,Rd
  145.      adds    #2,Rd                  bild    #x:3,@Rd
  146.      addx    #imm:8,Rd              bild    #x:3,@aa:8
  147.      addx    Rs,Rd                  bior    #x:3,Rd
  148.      and     #imm:8,Rd              bior    #x:3,@Rd
  149.      and     Rs,Rd                  bior    #x:3,@aa:8
  150.      andc    #imm:8,ccr             bist    #x:3,Rd
  151.      band    #x:3,Rd                bist    #x:3,@Rd
  152.      band    #x:3,@Rd               bist    #x:3,@aa:8
  153.      bra     d:8                    bixor   #x:3,Rd
  154.      bt      d:8                    bixor   #x:3,@Rd
  155.      brn     d:8                    bixor   #x:3,@aa:8
  156.      bf      d:8                    bld     #x:3,Rd
  157.      bhi     d:8                    bld     #x:3,@Rd
  158.      bls     d:8                    bld     #x:3,@aa:8
  159.      bcc     d:8                    bnot    #x:3,Rd
  160.      bhs     d:8                    bnot    #x:3,@Rd
  161.      bcs     d:8                    bnot    #x:3,@aa:8
  162.      blo     d:8                    bnot    Rs,Rd
  163.      bne     d:8                    bnot    Rs,@Rd
  164.      beq     d:8                    bnot    Rs,@aa:8
  165.      bvc     d:8                    bor     #x:3,Rd
  166.      bvs     d:8                    bor     #x:3,@Rd
  167.      bpl     d:8                    bor     #x:3,@aa:8
  168.      bmi     d:8                    bset    #x:3,@Rd
  169.      bge     d:8                    bset    #x:3,@aa:8
  170.      blt     d:8                    bset    Rs,Rd
  171.      bgt     d:8                    bset    Rs,@Rd
  172.      ble     d:8                    bset    Rs,@aa:8
  173.      bclr    #x:3,Rd                bsr     d:8
  174.      bclr    #x:3,@Rd               bst     #x:3,Rd
  175.      bclr    #x:3,@aa:8             bst     #x:3,@Rd
  176.      bclr    Rs,Rd                  bst     #x:3,@aa:8
  177.      bclr    Rs,@Rd                 btst    #x:3,Rd
  178.  
  179.      btst    #x:3,@Rd               mov.w   @(d:16, Rs),Rd
  180.      btst    #x:3,@aa:8             mov.w   @Rs+,Rd
  181.      btst    Rs,Rd                  mov.w   @aa:16,Rd
  182.      btst    Rs,@Rd                 mov.w   Rs,@Rd
  183.      btst    Rs,@aa:8               mov.w   Rs,@(d:16, Rd)
  184.      bxor    #x:3,Rd                mov.w   Rs,@-Rd
  185.      bxor    #x:3,@Rd               mov.w   Rs,@aa:16
  186.      bxor    #x:3,@aa:8             movfpe  @aa:16,Rd
  187.      cmp.b   #imm:8,Rd              movtpe  Rs,@aa:16
  188.      cmp.b   Rs,Rd                  mulxu   Rs,Rd
  189.      cmp.w   Rs,Rd                  neg     Rs
  190.      daa     Rs                     nop
  191.      das     Rs                     not     Rs
  192.      dec     Rs                     or      #imm:8,Rd
  193.      divxu   Rs,Rd                  or      Rs,Rd
  194.      eepmov                         orc     #imm:8,ccr
  195.      inc     Rs                     pop     Rs
  196.      jmp     @Rs                    push    Rs
  197.      jmp     @aa:16                 rotl    Rs
  198.      jmp     @@aa                   rotr    Rs
  199.      jsr     @Rs                    rotxl   Rs
  200.      jsr     @aa:16                 rotxr   Rs
  201.      jsr     @@aa:8                 rte
  202.      ldc     #imm:8,ccr             rts
  203.      ldc     Rs,ccr                 shal    Rs
  204.      mov.b   Rs,Rd                  shar    Rs
  205.      mov.b   #imm:8,Rd              shll    Rs
  206.      mov.b   @Rs,Rd                 shlr    Rs
  207.      mov.b   @(d:16, Rs),Rd         sleep
  208.      mov.b   @Rs+,Rd                stc     ccr,Rd
  209.      mov.b   @aa:16,Rd              sub.b   Rs,Rd
  210.      mov.b   @aa:8,Rd               sub.w   Rs,Rd
  211.      mov.b   Rs,@Rd                 subs    #1,Rd
  212.      mov.b   Rs,@(d:16, Rd)         subs    #2,Rd
  213.      mov.b   Rs,@-Rd                subx    #imm:8,Rd
  214.      mov.b   Rs,@aa:16              subx    Rs,Rd
  215.      mov.b   Rs,@aa:8               xor     #imm:8,Rd
  216.      mov.w   Rs,Rd                  xor     Rs,Rd
  217.      mov.w   #imm:16,Rd             xorc    #imm:8,ccr
  218.      mov.w   @Rs,Rd
  219.  
  220.    Four H8/300 instructions (`add', `cmp', `mov', `sub') are defined
  221. with variants using the suffixes `.b' and `.w' to specify the size of a
  222. memory operand.  `as' supports these suffixes, but does not require
  223. them; since one of the operands is always a register, `as' can deduce
  224. the correct size.
  225.  
  226.    For example, since `r0' refers to a 16-bit register,
  227.      mov    r0,@foo
  228. is equivalent to
  229.      mov.w  r0,@foo
  230.  
  231.    If you use the size suffixes, `as' will issue a warning if there's a
  232. mismatch between the suffix and the register size.
  233.  
  234. 
  235. File: as.info,  Node: i960-Dependent,  Next: M68K-Dependent,  Prev: H8/300-Dependent,  Up: Machine Dependent
  236.  
  237. Intel 80960 Dependent Features
  238. ==============================
  239.  
  240. * Menu:
  241.  
  242. * Options-i960::                i960 Command-line Options
  243. * Floating Point-i960::         Floating Point
  244. * Directives-i960::             i960 Machine Directives
  245. * Opcodes for i960::            i960 Opcodes
  246.  
  247. 
  248. File: as.info,  Node: Options-i960,  Next: Floating Point-i960,  Up: i960-Dependent
  249.  
  250. i960 Command-line Options
  251. -------------------------
  252.  
  253. `-ACA | -ACA_A | -ACB | -ACC | -AKA | -AKB | -AKC | -AMC'
  254.      Select the 80960 architecture.  Instructions or features not
  255.      supported by the selected architecture cause fatal errors.
  256.  
  257.      `-ACA' is equivalent to `-ACA_A'; `-AKC' is equivalent to `-AMC'. 
  258.      Synonyms are provided for compatibility with other tools.
  259.  
  260.      If none of these options is specified, `as' will generate code for
  261.      any instruction or feature that is supported by *some* version of
  262.      the 960 (even if this means mixing architectures!).  In principle,
  263.      `as' will attempt to deduce the minimal sufficient processor type
  264.      if none is specified; depending on the object code format, the
  265.      processor type may be recorded in the object file.  If it is
  266.      critical that the `as' output match a specific architecture,
  267.      specify that architecture explicitly.
  268.  
  269. `-b'
  270.      Add code to collect information about conditional branches taken,
  271.      for later optimization using branch prediction bits.  (The
  272.      conditional branch instructions have branch prediction bits in the
  273.      CA, CB, and CC architectures.)  If BR represents a conditional
  274.      branch instruction, the following represents the code generated by
  275.      the assembler when `-b' is specified:
  276.  
  277.                   call    INCREMENT ROUTINE
  278.                   .word   0       # pre-counter
  279.           Label:  BR
  280.                   call    INCREMENT ROUTINE
  281.                   .word   0       # post-counter
  282.  
  283.      The counter following a branch records the number of times that
  284.      branch was *not* taken; the differenc between the two counters is
  285.      the number of times the branch *was* taken.
  286.  
  287.      A table of every such `Label' is also generated, so that the
  288.      external postprocessor `gbr960' (supplied by Intel) can locate all
  289.      the counters.  This table is always labelled `__BRANCH_TABLE__';
  290.      this is a local symbol to permit collecting statistics for many
  291.      separate object files.  The table is word aligned, and begins with
  292.      a two-word header.  The first word, initialized to 0, is used in
  293.      maintaining linked lists of branch tables.  The second word is a
  294.      count of the number of entries in the table, which follow
  295.      immediately: each is a word, pointing to one of the labels
  296.      illustrated above.
  297.  
  298.            +------------+------------+------------+ ... +------------+
  299.            |            |            |            |     |            |
  300.            |  *NEXT     |  COUNT: N  | *BRLAB 1   |     | *BRLAB N   |
  301.            |            |            |            |     |            |
  302.            +------------+------------+------------+ ... +------------+
  303.           
  304.                          __BRANCH_TABLE__ layout
  305.  
  306.      The first word of the header is used to locate multiple branch
  307.      tables, since each object file may contain one. Normally the links
  308.      are maintained with a call to an initialization routine, placed at
  309.      the beginning of each function in the file.  The GNU C compiler
  310.      will generate these calls automatically when you give it a `-b'
  311.      option. For further details, see the documentation of `gbr960'.
  312.  
  313. `-norelax'
  314.      Normally, Compare-and-Branch instructions with targets that require
  315.      displacements greater than 13 bits (or that have external targets)
  316.      are replaced with the corresponding compare (or `chkbit') and
  317.      branch instructions.  You can use the `-norelax' option to specify
  318.      that `as' should generate errors instead, if the target
  319.      displacement is larger than 13 bits.
  320.  
  321.      This option does not affect the Compare-and-Jump instructions; the
  322.      code emitted for them is *always* adjusted when necessary
  323.      (depending on displacement size), regardless of whether you use
  324.      `-norelax'.
  325.  
  326. 
  327. File: as.info,  Node: Floating Point-i960,  Next: Directives-i960,  Prev: Options-i960,  Up: i960-Dependent
  328.  
  329. Floating Point
  330. --------------
  331.  
  332.    `as' generates IEEE floating-point numbers for the directives
  333. `.float', `.double', `.extended', and `.single'.
  334.  
  335. 
  336. File: as.info,  Node: Directives-i960,  Next: Opcodes for i960,  Prev: Floating Point-i960,  Up: i960-Dependent
  337.  
  338. i960 Machine Directives
  339. -----------------------
  340.  
  341. `.bss SYMBOL, LENGTH, ALIGN'
  342.      Reserve LENGTH bytes in the bss section for a local SYMBOL,
  343.      aligned to the power of two specified by ALIGN.  LENGTH and ALIGN
  344.      must be positive absolute expressions.  This directive differs
  345.      from `.lcomm' only in that it permits you to specify an alignment.
  346.       *Note `.lcomm': Lcomm.
  347.  
  348. `.extended FLONUMS'
  349.      `.extended' expects zero or more flonums, separated by commas; for
  350.      each flonum, `.extended' emits an IEEE extended-format (80-bit)
  351.      floating-point number.
  352.  
  353. `.leafproc CALL-LAB, BAL-LAB'
  354.      You can use the `.leafproc' directive in conjunction with the
  355.      optimized `callj' instruction to enable faster calls of leaf
  356.      procedures.  If a procedure is known to call no other procedures,
  357.      you may define an entry point that skips procedure prolog code
  358.      (and that does not depend on system-supplied saved context), and
  359.      declare it as the BAL-LAB using `.leafproc'.  If the procedure
  360.      also has an entry point that goes through the normal prolog, you
  361.      can specify that entry point as CALL-LAB.
  362.  
  363.      A `.leafproc' declaration is meant for use in conjunction with the
  364.      optimized call instruction `callj'; the directive records the data
  365.      needed later to choose between converting the `callj' into a `bal'
  366.      or a `call'.
  367.  
  368.      CALL-LAB is optional; if only one argument is present, or if the
  369.      two arguments are identical, the single argument is assumed to be
  370.      the `bal' entry point.
  371.  
  372. `.sysproc NAME, INDEX'
  373.      The `.sysproc' directive defines a name for a system procedure.
  374.      After you define it using `.sysproc', you can use NAME to refer to
  375.      the system procedure identified by INDEX when calling procedures
  376.      with the optimized call instruction `callj'.
  377.  
  378.      Both arguments are required; INDEX must be between 0 and 31
  379.      (inclusive).
  380.  
  381. 
  382. File: as.info,  Node: Opcodes for i960,  Prev: Directives-i960,  Up: i960-Dependent
  383.  
  384. i960 Opcodes
  385. ------------
  386.  
  387.    All Intel 960 machine instructions are supported; *note i960
  388. Command-line Options: Options-i960. for a discussion of selecting the
  389. instruction subset for a particular 960 architecture.
  390.  
  391.    Some opcodes are processed beyond simply emitting a single
  392. corresponding instruction: `callj', and Compare-and-Branch or
  393. Compare-and-Jump instructions with target displacements larger than 13
  394. bits.
  395.  
  396. * Menu:
  397.  
  398. * callj-i960::                  `callj'
  399. * Compare-and-branch-i960::     Compare-and-Branch
  400.  
  401. 
  402. File: as.info,  Node: callj-i960,  Next: Compare-and-branch-i960,  Up: Opcodes for i960
  403.  
  404. `callj'
  405. .......
  406.  
  407.    You can write `callj' to have the assembler or the linker determine
  408. the most appropriate form of subroutine call: `call', `bal', or
  409. `calls'.  If the assembly source contains enough information--a
  410. `.leafproc' or `.sysproc' directive defining the operand--then `as'
  411. will translate the `callj'; if not, it will simply emit the `callj',
  412. leaving it for the linker to resolve.
  413.  
  414. 
  415. File: as.info,  Node: Compare-and-branch-i960,  Prev: callj-i960,  Up: Opcodes for i960
  416.  
  417. Compare-and-Branch
  418. ..................
  419.  
  420.    The 960 architectures provide combined Compare-and-Branch
  421. instructions that permit you to store the branch target in the lower 13
  422. bits of the instruction word itself.  However, if you specify a branch
  423. target far enough away that its address won't fit in 13 bits, the
  424. assembler can either issue an error, or convert your Compare-and-Branch
  425. instruction into separate instructions to do the compare and the branch.
  426.  
  427.    Whether `as' gives an error or expands the instruction depends on
  428. two choices you can make: whether you use the `-norelax' option, and
  429. whether you use a "Compare and Branch" instruction or a "Compare and
  430. Jump" instruction.  The "Jump" instructions are *always* expanded if
  431. necessary; the "Branch" instructions are expanded when necessary
  432. *unless* you specify `-norelax'--in which case `as' gives an error
  433. instead.
  434.  
  435.    These are the Compare-and-Branch instructions, their "Jump" variants,
  436. and the instruction pairs they may expand into:
  437.  
  438.              Compare and
  439.           Branch      Jump       Expanded to
  440.           ------    ------       ------------
  441.              bbc                 chkbit; bno
  442.              bbs                 chkbit; bo
  443.           cmpibe    cmpije       cmpi; be
  444.           cmpibg    cmpijg       cmpi; bg
  445.          cmpibge   cmpijge       cmpi; bge
  446.           cmpibl    cmpijl       cmpi; bl
  447.          cmpible   cmpijle       cmpi; ble
  448.          cmpibno   cmpijno       cmpi; bno
  449.          cmpibne   cmpijne       cmpi; bne
  450.           cmpibo    cmpijo       cmpi; bo
  451.           cmpobe    cmpoje       cmpo; be
  452.           cmpobg    cmpojg       cmpo; bg
  453.          cmpobge   cmpojge       cmpo; bge
  454.           cmpobl    cmpojl       cmpo; bl
  455.          cmpoble   cmpojle       cmpo; ble
  456.          cmpobne   cmpojne       cmpo; bne
  457.  
  458. 
  459. File: as.info,  Node: M68K-Dependent,  Next: Sparc-Dependent,  Prev: i960-Dependent,  Up: Machine Dependent
  460.  
  461. M680x0 Dependent Features
  462. =========================
  463.  
  464. * Menu:
  465.  
  466. * M68K-Opts::                   M680x0 Options
  467. * M68K-Syntax::                 Syntax
  468. * M68K-Float::                  Floating Point
  469. * M68K-Directives::             680x0 Machine Directives
  470. * M68K-opcodes::                Opcodes
  471.  
  472. 
  473. File: as.info,  Node: M68K-Opts,  Next: M68K-Syntax,  Up: M68K-Dependent
  474.  
  475. M680x0 Options
  476. --------------
  477.  
  478.    The Motorola 680x0 version of `as' has two machine dependent options.
  479. One shortens undefined references from 32 to 16 bits, while the other
  480. is used to tell `as' what kind of machine it is assembling for.
  481.  
  482.    You can use the `-l' option to shorten the size of references to
  483. undefined symbols.  If the `-l' option is not given, references to
  484. undefined symbols will be a full long (32 bits) wide.  (Since `as'
  485. cannot know where these symbols will end up, `as' can only allocate
  486. space for the linker to fill in later.  Since `as' doesn't know how far
  487. away these symbols will be, it allocates as much space as it can.) If
  488. this option is given, the references will only be one word wide (16
  489. bits).  This may be useful if you want the object file to be as small as
  490. possible, and you know that the relevant symbols will be less than 17
  491. bits away.
  492.  
  493.    The 680x0 version of `as' is most frequently used to assemble
  494. programs for the Motorola MC68020 microprocessor.  Occasionally it is
  495. used to assemble programs for the mostly similar, but slightly different
  496. MC68000 or MC68010 microprocessors.  You can give `as' the options
  497. `-m68000', `-mc68000', `-m68010', `-mc68010', `-m68020', and `-mc68020'
  498. to tell it what processor is the target.
  499.  
  500. 
  501. File: as.info,  Node: M68K-Syntax,  Next: M68K-Float,  Prev: M68K-Opts,  Up: M68K-Dependent
  502.  
  503. Syntax
  504. ------
  505.  
  506.    The 680x0 version of `as' uses syntax similar to the Sun assembler.
  507. Size modifiers are appended directly to the end of the opcode without an
  508. intervening period.  For example, write `movl' rather than `move.l'.
  509.  
  510.    In the following table "apc" stands for any of the address registers
  511. (`a0' through `a7'), nothing, (`'), the Program Counter (`pc'), or the
  512. zero-address relative to the program counter (`zpc').
  513.  
  514.    The following addressing modes are understood:
  515. "Immediate"
  516.      `#DIGITS'
  517.  
  518. "Data Register"
  519.      `d0' through `d7'
  520.  
  521. "Address Register"
  522.      `a0' through `a7'
  523.  
  524. "Address Register Indirect"
  525.      `a0@' through `a7@'
  526.  
  527. "Address Register Postincrement"
  528.      `a0@+' through `a7@+'
  529.  
  530. "Address Register Predecrement"
  531.      `a0@-' through `a7@-'
  532.  
  533. "Indirect Plus Offset"
  534.      `APC@(DIGITS)'
  535.  
  536. "Index"
  537.      `APC@(DIGITS,REGISTER:SIZE:SCALE)'
  538.  
  539.      or `APC@(REGISTER:SIZE:SCALE)'
  540.  
  541. "Postindex"
  542.      `APC@(DIGITS)@(DIGITS,REGISTER:SIZE:SCALE)'
  543.  
  544.      or `APC@(DIGITS)@(REGISTER:SIZE:SCALE)'
  545.  
  546. "Preindex"
  547.      `APC@(DIGITS,REGISTER:SIZE:SCALE)@(DIGITS)'
  548.  
  549.      or `APC@(REGISTER:SIZE:SCALE)@(DIGITS)'
  550.  
  551. "Memory Indirect"
  552.      `APC@(DIGITS)@(DIGITS)'
  553.  
  554. "Absolute"
  555.      `SYMBOL', or `DIGITS'
  556.  
  557. 
  558. File: as.info,  Node: M68K-Float,  Next: M68K-Directives,  Prev: M68K-Syntax,  Up: M68K-Dependent
  559.  
  560. Floating Point
  561. --------------
  562.  
  563.    The floating point code is not too well tested, and may have subtle
  564. bugs in it.
  565.  
  566.    Packed decimal (P) format floating literals are not supported. Feel
  567. free to add the code!
  568.  
  569.    The floating point formats generated by directives are these.
  570.  
  571. `.float'
  572.      `Single' precision floating point constants.
  573.  
  574. `.double'
  575.      `Double' precision floating point constants.
  576.  
  577.    There is no directive to produce regions of memory holding extended
  578. precision numbers, however they can be used as immediate operands to
  579. floating-point instructions.  Adding a directive to create extended
  580. precision numbers would not be hard, but it has not yet seemed
  581. necessary.
  582.  
  583. 
  584. File: as.info,  Node: M68K-Directives,  Next: M68K-opcodes,  Prev: M68K-Float,  Up: M68K-Dependent
  585.  
  586. 680x0 Machine Directives
  587. ------------------------
  588.  
  589.    In order to be compatible with the Sun assembler the 680x0 assembler
  590. understands the following directives.
  591.  
  592. `.data1'
  593.      This directive is identical to a `.data 1' directive.
  594.  
  595. `.data2'
  596.      This directive is identical to a `.data 2' directive.
  597.  
  598. `.even'
  599.      This directive is identical to a `.align 1' directive.
  600.  
  601. `.skip'
  602.      This directive is identical to a `.space' directive.
  603.  
  604. 
  605. File: as.info,  Node: M68K-opcodes,  Prev: M68K-Directives,  Up: M68K-Dependent
  606.  
  607. Opcodes
  608. -------
  609.  
  610. * Menu:
  611.  
  612. * M68K-Branch::                 Branch Improvement
  613. * M68K-Chars::                  Special Characters
  614.  
  615. 
  616. File: as.info,  Node: M68K-Branch,  Next: M68K-Chars,  Up: M68K-opcodes
  617.  
  618. Branch Improvement
  619. ..................
  620.  
  621.    Certain pseudo opcodes are permitted for branch instructions. They
  622. expand to the shortest branch instruction that will reach the target. 
  623. Generally these mnemonics are made by substituting `j' for `b' at the
  624. start of a Motorola mnemonic.
  625.  
  626.    The following table summarizes the pseudo-operations.  A `*' flags
  627. cases that are more fully described after the table:
  628.  
  629.                Displacement
  630.                +-------------------------------------------------
  631.                |                68020   68000/10
  632.      Pseudo-Op |BYTE    WORD    LONG    LONG      non-PC relative
  633.                +-------------------------------------------------
  634.           jbsr |bsrs    bsr     bsrl    jsr       jsr
  635.            jra |bras    bra     bral    jmp       jmp
  636.      *     jXX |bXXs    bXX     bXXl    bNXs;jmpl bNXs;jmp
  637.      *    dbXX |dbXX    dbXX        dbXX; bra; jmpl
  638.      *    fjXX |fbXXw   fbXXw   fbXXl             fbNXw;jmp
  639.      
  640.      XX: condition
  641.      NX: negative of condition XX
  642.  
  643.                     `*'--see full description below
  644.  
  645. `jbsr'
  646. `jra'
  647.      These are the simplest jump pseudo-operations; they always map to
  648.      one particular machine instruction, depending on the displacement
  649.      to the branch target.
  650.  
  651. `jXX'
  652.      Here, `jXX' stands for an entire family of pseudo-operations,
  653.      where XX is a conditional branch or condition-code test.  The full
  654.      list of pseudo-ops in this family is:
  655.            jhi   jls   jcc   jcs   jne   jeq   jvc
  656.            jvs   jpl   jmi   jge   jlt   jgt   jle
  657.  
  658.      For the cases of non-PC relative displacements and long
  659.      displacements on the 68000 or 68010, `as' will issue a longer code
  660.      fragment in terms of NX, the opposite condition to XX.  For
  661.      example, for the non-PC relative case:
  662.               jXX foo
  663.      gives
  664.                bNXs oof
  665.                jmp foo
  666.            oof:
  667.  
  668. `dbXX'
  669.      The full family of pseudo-operations covered here is
  670.            dbhi   dbls   dbcc   dbcs   dbne   dbeq   dbvc
  671.            dbvs   dbpl   dbmi   dbge   dblt   dbgt   dble
  672.            dbf    dbra   dbt
  673.  
  674.      Other than for word and byte displacements, when the source reads
  675.      `dbXX foo', `as' will emit
  676.                dbXX oo1
  677.                bra oo2
  678.            oo1:jmpl foo
  679.            oo2:
  680.  
  681. `fjXX'
  682.      This family includes
  683.            fjne   fjeq   fjge   fjlt   fjgt   fjle   fjf
  684.            fjt    fjgl   fjgle  fjnge  fjngl  fjngle fjngt
  685.            fjnle  fjnlt  fjoge  fjogl  fjogt  fjole  fjolt
  686.            fjor   fjseq  fjsf   fjsne  fjst   fjueq  fjuge
  687.            fjugt  fjule  fjult  fjun
  688.  
  689.      For branch targets that are not PC relative, `as' emits
  690.                fbNX oof
  691.                jmp foo
  692.            oof:
  693.      when it encounters `fjXX foo'.
  694.  
  695. 
  696. File: as.info,  Node: M68K-Chars,  Prev: M68K-Branch,  Up: M68K-opcodes
  697.  
  698. Special Characters
  699. ..................
  700.  
  701.    The immediate character is `#' for Sun compatibility.  The
  702. line-comment character is `|'.  If a `#' appears at the beginning of a
  703. line, it is treated as a comment unless it looks like `# line file', in
  704. which case it is treated normally.
  705.  
  706. 
  707. File: as.info,  Node: Sparc-Dependent,  Next: Z8000-Dependent,  Prev: M68K-Dependent,  Up: Machine Dependent
  708.  
  709. SPARC Dependent Features
  710. ========================
  711.  
  712. * Menu:
  713.  
  714. * Sparc-Opts::                  Options
  715. * Sparc-Float::                 Floating Point
  716. * Sparc-Directives::            Sparc Machine Directives
  717.  
  718. 
  719. File: as.info,  Node: Sparc-Opts,  Next: Sparc-Float,  Up: Sparc-Dependent
  720.  
  721. Options
  722. -------
  723.  
  724.    The Sparc has no machine dependent options.
  725.  
  726. 
  727. File: as.info,  Node: Sparc-Float,  Next: Sparc-Directives,  Prev: Sparc-Opts,  Up: Sparc-Dependent
  728.  
  729. Floating Point
  730. --------------
  731.  
  732.    The Sparc uses IEEE floating-point numbers.
  733.  
  734. 
  735. File: as.info,  Node: Sparc-Directives,  Prev: Sparc-Float,  Up: Sparc-Dependent
  736.  
  737. Sparc Machine Directives
  738. ------------------------
  739.  
  740.    The Sparc version of `as' supports the following additional machine
  741. directives:
  742.  
  743. `.common'
  744.      This must be followed by a symbol name, a positive number, and
  745.      `"bss"'.  This behaves somewhat like `.comm', but the syntax is
  746.      different.
  747.  
  748. `.half'
  749.      This is functionally identical to `.short'.
  750.  
  751. `.proc'
  752.      This directive is ignored.  Any text following it on the same line
  753.      is also ignored.
  754.  
  755. `.reserve'
  756.      This must be followed by a symbol name, a positive number, and
  757.      `"bss"'.  This behaves somewhat like `.lcomm', but the syntax is
  758.      different.
  759.  
  760. `.seg'
  761.      This must be followed by `"text"', `"data"', or `"data1"'.  It
  762.      behaves like `.text', `.data', or `.data 1'.
  763.  
  764. `.skip'
  765.      This is functionally identical to the `.space' directive.
  766.  
  767. `.word'
  768.      On the Sparc, the .word directive produces 32 bit values, instead
  769.      of the 16 bit values it produces on many other machines.
  770.  
  771. 
  772. File: as.info,  Node: i386-Dependent,  Prev: Z8000-Dependent,  Up: Machine Dependent
  773.  
  774. 80386 Dependent Features
  775. ========================
  776.  
  777. * Menu:
  778.  
  779. * i386-Options::                Options
  780. * i386-Syntax::                 AT&T Syntax versus Intel Syntax
  781. * i386-Opcodes::                Opcode Naming
  782. * i386-Regs::                   Register Naming
  783. * i386-prefixes::               Opcode Prefixes
  784. * i386-Memory::                 Memory References
  785. * i386-jumps::                  Handling of Jump Instructions
  786. * i386-Float::                  Floating Point
  787. * i386-Notes::                  Notes
  788.  
  789. 
  790. File: as.info,  Node: i386-Options,  Next: i386-Syntax,  Up: i386-Dependent
  791.  
  792. Options
  793. -------
  794.  
  795.    The 80386 has no machine dependent options.
  796.  
  797. 
  798. File: as.info,  Node: i386-Syntax,  Next: i386-Opcodes,  Prev: i386-Options,  Up: i386-Dependent
  799.  
  800. AT&T Syntax versus Intel Syntax
  801. -------------------------------
  802.  
  803.    In order to maintain compatibility with the output of `gcc', `as'
  804. supports AT&T System V/386 assembler syntax.  This is quite different
  805. from Intel syntax.  We mention these differences because almost all
  806. 80386 documents used only Intel syntax.  Notable differences between
  807. the two syntaxes are:
  808.  
  809.    * AT&T immediate operands are preceded by `$'; Intel immediate
  810.      operands are undelimited (Intel `push 4' is AT&T `pushl $4'). AT&T
  811.      register operands are preceded by `%'; Intel register operands are
  812.      undelimited.  AT&T absolute (as opposed to PC relative) jump/call
  813.      operands are prefixed by `*'; they are undelimited in Intel syntax.
  814.  
  815.    * AT&T and Intel syntax use the opposite order for source and
  816.      destination operands.  Intel `add eax, 4' is `addl $4, %eax'.  The
  817.      `source, dest' convention is maintained for compatibility with
  818.      previous Unix assemblers.
  819.  
  820.    * In AT&T syntax the size of memory operands is determined from the
  821.      last character of the opcode name.  Opcode suffixes of `b', `w',
  822.      and `l' specify byte (8-bit), word (16-bit), and long (32-bit)
  823.      memory references.  Intel syntax accomplishes this by prefixes
  824.      memory operands (*not* the opcodes themselves) with `byte ptr',
  825.      `word ptr', and `dword ptr'.  Thus, Intel `mov al, byte ptr FOO'
  826.      is `movb FOO, %al' in AT&T syntax.
  827.  
  828.    * Immediate form long jumps and calls are `lcall/ljmp $SECTION,
  829.      $OFFSET' in AT&T syntax; the Intel syntax is `call/jmp far
  830.      SECTION:OFFSET'.  Also, the far return instruction is `lret
  831.      $STACK-ADJUST' in AT&T syntax; Intel syntax is `ret far
  832.      STACK-ADJUST'.
  833.  
  834.    * The AT&T assembler does not provide support for multiple section
  835.      programs.  Unix style systems expect all programs to be single
  836.      sections.
  837.  
  838. 
  839. File: as.info,  Node: i386-Opcodes,  Next: i386-Regs,  Prev: i386-Syntax,  Up: i386-Dependent
  840.  
  841. Opcode Naming
  842. -------------
  843.  
  844.    Opcode names are suffixed with one character modifiers which specify
  845. the size of operands.  The letters `b', `w', and `l' specify byte,
  846. word, and long operands.  If no suffix is specified by an instruction
  847. and it contains no memory operands then `as' tries to fill in the
  848. missing suffix based on the destination register operand (the last one
  849. by convention).  Thus, `mov %ax, %bx' is equivalent to `movw %ax, %bx';
  850. also, `mov $1, %bx' is equivalent to `movw $1, %bx'.  Note that this is
  851. incompatible with the AT&T Unix assembler which assumes that a missing
  852. opcode suffix implies long operand size.  (This incompatibility does
  853. not affect compiler output since compilers always explicitly specify
  854. the opcode suffix.)
  855.  
  856.    Almost all opcodes have the same names in AT&T and Intel format. 
  857. There are a few exceptions.  The sign extend and zero extend
  858. instructions need two sizes to specify them.  They need a size to
  859. sign/zero extend *from* and a size to zero extend *to*.  This is
  860. accomplished by using two opcode suffixes in AT&T syntax.  Base names
  861. for sign extend and zero extend are `movs...' and `movz...' in AT&T
  862. syntax (`movsx' and `movzx' in Intel syntax).  The opcode suffixes are
  863. tacked on to this base name, the *from* suffix before the *to* suffix. 
  864. Thus, `movsbl %al, %edx' is AT&T syntax for "move sign extend *from*
  865. %al *to* %edx."  Possible suffixes, thus, are `bl' (from byte to long),
  866. `bw' (from byte to word), and `wl' (from word to long).
  867.  
  868.    The Intel-syntax conversion instructions
  869.  
  870.    * `cbw' -- sign-extend byte in `%al' to word in `%ax',
  871.  
  872.    * `cwde' -- sign-extend word in `%ax' to long in `%eax',
  873.  
  874.    * `cwd' -- sign-extend word in `%ax' to long in `%dx:%ax',
  875.  
  876.    * `cdq' -- sign-extend dword in `%eax' to quad in `%edx:%eax',
  877.  
  878. are called `cbtw', `cwtl', `cwtd', and `cltd' in AT&T naming.  `as'
  879. accepts either naming for these instructions.
  880.  
  881.    Far call/jump instructions are `lcall' and `ljmp' in AT&T syntax,
  882. but are `call far' and `jump far' in Intel convention.
  883.  
  884. 
  885. File: as.info,  Node: i386-Regs,  Next: i386-prefixes,  Prev: i386-Opcodes,  Up: i386-Dependent
  886.  
  887. Register Naming
  888. ---------------
  889.  
  890.    Register operands are always prefixes with `%'.  The 80386 registers
  891. consist of
  892.  
  893.    * the 8 32-bit registers `%eax' (the accumulator), `%ebx', `%ecx',
  894.      `%edx', `%edi', `%esi', `%ebp' (the frame pointer), and `%esp'
  895.      (the stack pointer).
  896.  
  897.    * the 8 16-bit low-ends of these: `%ax', `%bx', `%cx', `%dx', `%di',
  898.      `%si', `%bp', and `%sp'.
  899.  
  900.    * the 8 8-bit registers: `%ah', `%al', `%bh', `%bl', `%ch', `%cl',
  901.      `%dh', and `%dl' (These are the high-bytes and low-bytes of `%ax',
  902.      `%bx', `%cx', and `%dx')
  903.  
  904.    * the 6 section registers `%cs' (code section), `%ds' (data
  905.      section), `%ss' (stack section), `%es', `%fs', and `%gs'.
  906.  
  907.    * the 3 processor control registers `%cr0', `%cr2', and `%cr3'.
  908.  
  909.    * the 6 debug registers `%db0', `%db1', `%db2', `%db3', `%db6', and
  910.      `%db7'.
  911.  
  912.    * the 2 test registers `%tr6' and `%tr7'.
  913.  
  914.    * the 8 floating point register stack `%st' or equivalently
  915.      `%st(0)', `%st(1)', `%st(2)', `%st(3)', `%st(4)', `%st(5)',
  916.      `%st(6)', and `%st(7)'.
  917.  
  918. 
  919. File: as.info,  Node: i386-prefixes,  Next: i386-Memory,  Prev: i386-Regs,  Up: i386-Dependent
  920.  
  921. Opcode Prefixes
  922. ---------------
  923.  
  924.    Opcode prefixes are used to modify the following opcode.  They are
  925. used to repeat string instructions, to provide section overrides, to
  926. perform bus lock operations, and to give operand and address size
  927. (16-bit operands are specified in an instruction by prefixing what would
  928. normally be 32-bit operands with a "operand size" opcode prefix).
  929. Opcode prefixes are usually given as single-line instructions with no
  930. operands, and must directly precede the instruction they act upon.  For
  931. example, the `scas' (scan string) instruction is repeated with:
  932.              repne
  933.              scas
  934.  
  935.    Here is a list of opcode prefixes:
  936.  
  937.    * Section override prefixes `cs', `ds', `ss', `es', `fs', `gs'. 
  938.      These are automatically added by specifying using the
  939.      SECTION:MEMORY-OPERAND form for memory references.
  940.  
  941.    * Operand/Address size prefixes `data16' and `addr16' change 32-bit
  942.      operands/addresses into 16-bit operands/addresses.  Note that
  943.      16-bit addressing modes (i.e. 8086 and 80286 addressing modes) are
  944.      not supported (yet).
  945.  
  946.    * The bus lock prefix `lock' inhibits interrupts during execution of
  947.      the instruction it precedes.  (This is only valid with certain
  948.      instructions; see a 80386 manual for details).
  949.  
  950.    * The wait for coprocessor prefix `wait' waits for the coprocessor
  951.      to complete the current instruction.  This should never be needed
  952.      for the 80386/80387 combination.
  953.  
  954.    * The `rep', `repe', and `repne' prefixes are added to string
  955.      instructions to make them repeat `%ecx' times.
  956.  
  957. 
  958. File: as.info,  Node: i386-Memory,  Next: i386-jumps,  Prev: i386-prefixes,  Up: i386-Dependent
  959.  
  960. Memory References
  961. -----------------
  962.  
  963.    An Intel syntax indirect memory reference of the form
  964.  
  965.      SECTION:[BASE + INDEX*SCALE + DISP]
  966.  
  967. is translated into the AT&T syntax
  968.  
  969.      SECTION:DISP(BASE, INDEX, SCALE)
  970.  
  971. where BASE and INDEX are the optional 32-bit base and index registers,
  972. DISP is the optional displacement, and SCALE, taking the values 1, 2,
  973. 4, and 8, multiplies INDEX to calculate the address of the operand.  If
  974. no SCALE is specified, SCALE is taken to be 1.  SECTION specifies the
  975. optional section register for the memory operand, and may override the
  976. default section register (see a 80386 manual for section register
  977. defaults). Note that section overrides in AT&T syntax *must* have be
  978. preceded by a `%'.  If you specify a section override which coincides
  979. with the default section register, `as' will *not* output any section
  980. register override prefixes to assemble the given instruction.  Thus,
  981. section overrides can be specified to emphasize which section register
  982. is used for a given memory operand.
  983.  
  984.    Here are some examples of Intel and AT&T style memory references:
  985.  
  986. AT&T: `-4(%ebp)', Intel:  `[ebp - 4]'
  987.      BASE is `%ebp'; DISP is `-4'. SECTION is missing, and the default
  988.      section is used (`%ss' for addressing with `%ebp' as the base
  989.      register).  INDEX, SCALE are both missing.
  990.  
  991. AT&T: `foo(,%eax,4)', Intel: `[foo + eax*4]'
  992.      INDEX is `%eax' (scaled by a SCALE 4); DISP is `foo'.  All other
  993.      fields are missing.  The section register here defaults to `%ds'.
  994.  
  995. AT&T: `foo(,1)'; Intel `[foo]'
  996.      This uses the value pointed to by `foo' as a memory operand. Note
  997.      that BASE and INDEX are both missing, but there is only *one* `,'.
  998.       This is a syntactic exception.
  999.  
  1000. AT&T: `%gs:foo'; Intel `gs:foo'
  1001.      This selects the contents of the variable `foo' with section
  1002.      register SECTION being `%gs'.
  1003.  
  1004.    Absolute (as opposed to PC relative) call and jump operands must be
  1005. prefixed with `*'.  If no `*' is specified, `as' will always choose PC
  1006. relative addressing for jump/call labels.
  1007.  
  1008.    Any instruction that has a memory operand *must* specify its size
  1009. (byte, word, or long) with an opcode suffix (`b', `w', or `l',
  1010. respectively).
  1011.  
  1012. 
  1013. File: as.info,  Node: i386-jumps,  Next: i386-Float,  Prev: i386-Memory,  Up: i386-Dependent
  1014.  
  1015. Handling of Jump Instructions
  1016. -----------------------------
  1017.  
  1018.    Jump instructions are always optimized to use the smallest possible
  1019. displacements.  This is accomplished by using byte (8-bit) displacement
  1020. jumps whenever the target is sufficiently close.  If a byte displacement
  1021. is insufficient a long (32-bit) displacement is used.  We do not support
  1022. word (16-bit) displacement jumps (i.e. prefixing the jump instruction
  1023. with the `addr16' opcode prefix), since the 80386 insists upon masking
  1024. `%eip' to 16 bits after the word displacement is added.
  1025.  
  1026.    Note that the `jcxz', `jecxz', `loop', `loopz', `loope', `loopnz'
  1027. and `loopne' instructions only come in byte displacements, so that it
  1028. is possible that use of these instructions (`gcc' does not use them)
  1029. will cause the assembler to print an error message (and generate
  1030. incorrect code).  The AT&T 80386 assembler tries to get around this
  1031. problem by expanding `jcxz foo' to
  1032.               jcxz cx_zero
  1033.               jmp cx_nonzero
  1034.      cx_zero: jmp foo
  1035.      cx_nonzero:
  1036.  
  1037. 
  1038. File: as.info,  Node: i386-Float,  Next: i386-Notes,  Prev: i386-jumps,  Up: i386-Dependent
  1039.  
  1040. Floating Point
  1041. --------------
  1042.  
  1043.    All 80387 floating point types except packed BCD are supported. (BCD
  1044. support may be added without much difficulty).  These data types are
  1045. 16-, 32-, and 64- bit integers, and single (32-bit), double (64-bit),
  1046. and extended (80-bit) precision floating point. Each supported type has
  1047. an opcode suffix and a constructor associated with it.  Opcode suffixes
  1048. specify operand's data types.  Constructors build these data types into
  1049. memory.
  1050.  
  1051.    * Floating point constructors are `.float' or `.single', `.double',
  1052.      and `.tfloat' for 32-, 64-, and 80-bit formats. These correspond
  1053.      to opcode suffixes `s', `l', and `t'. `t' stands for temporary
  1054.      real, and that the 80387 only supports this format via the `fldt'
  1055.      (load temporary real to stack top) and `fstpt' (store temporary
  1056.      real and pop stack) instructions.
  1057.  
  1058.    * Integer constructors are `.word', `.long' or `.int', and `.quad'
  1059.      for the 16-, 32-, and 64-bit integer formats.  The corresponding
  1060.      opcode suffixes are `s' (single), `l' (long), and `q' (quad).  As
  1061.      with the temporary real format the 64-bit `q' format is only
  1062.      present in the `fildq' (load quad integer to stack top) and
  1063.      `fistpq' (store quad integer and pop stack) instructions.
  1064.  
  1065.    Register to register operations do not require opcode suffixes, so
  1066. that `fst %st, %st(1)' is equivalent to `fstl %st, %st(1)'.
  1067.  
  1068.    Since the 80387 automatically synchronizes with the 80386 `fwait'
  1069. instructions are almost never needed (this is not the case for the
  1070. 80286/80287 and 8086/8087 combinations).  Therefore, `as' suppresses
  1071. the `fwait' instruction whenever it is implicitly selected by one of
  1072. the `fn...' instructions.  For example, `fsave' and `fnsave' are
  1073. treated identically.  In general, all the `fn...' instructions are made
  1074. equivalent to `f...' instructions.  If `fwait' is desired it must be
  1075. explicitly coded.
  1076.  
  1077. 
  1078. File: as.info,  Node: i386-Notes,  Prev: i386-Float,  Up: i386-Dependent
  1079.  
  1080. Notes
  1081. -----
  1082.  
  1083.    There is some trickery concerning the `mul' and `imul' instructions
  1084. that deserves mention.  The 16-, 32-, and 64-bit expanding multiplies
  1085. (base opcode `0xf6'; extension 4 for `mul' and 5 for `imul') can be
  1086. output only in the one operand form.  Thus, `imul %ebx, %eax' does
  1087. *not* select the expanding multiply; the expanding multiply would
  1088. clobber the `%edx' register, and this would confuse `gcc' output.  Use
  1089. `imul %ebx' to get the 64-bit product in `%edx:%eax'.
  1090.  
  1091.    We have added a two operand form of `imul' when the first operand is
  1092. an immediate mode expression and the second operand is a register. This
  1093. is just a shorthand, so that, multiplying `%eax' by 69, for example,
  1094. can be done with `imul $69, %eax' rather than `imul $69, %eax, %eax'.
  1095.  
  1096. 
  1097. File: as.info,  Node: Z8000-Dependent,  Next: i386-Dependent,  Prev: Sparc-Dependent,  Up: Machine Dependent
  1098.  
  1099. Z8000 Dependent Features
  1100. ========================
  1101.  
  1102.    The Z8000 as supports both members of the Z8000 family: the
  1103. unsegmented Z8002, with 16 bit addresses, and the segmented Z8001 with
  1104. 24 bit addresses.
  1105.  
  1106.    When the assembler is in unsegmented mode (specified with the
  1107. `unsegm' directive), an address will take up one word (16 bit) sized
  1108. register.  When the assembler is in segmented mode (specified with the
  1109. `segm' directive), a 24-bit address takes up a long (32 bit) register. 
  1110. *Note Assembler Directives for the Z8000: Z8000 Directives, for a list
  1111. of other Z8000 specific assembler directives.
  1112.  
  1113. * Menu:
  1114.  
  1115. * Z8000 Options::               No special command-line options for Z8000
  1116. * Z8000 Syntax::                Assembler syntax for the Z8000
  1117. * Z8000 Directives::            Special directives for the Z8000
  1118. * Z8000 Opcodes::               Opcodes
  1119.  
  1120. 
  1121. File: as.info,  Node: Z8000 Options,  Next: Z8000 Syntax,  Up: Z8000-Dependent
  1122.  
  1123. Options
  1124. -------
  1125.  
  1126.    `as' has no additional command-line options for the Zilog Z8000
  1127. family.
  1128.  
  1129. 
  1130. File: as.info,  Node: Z8000 Syntax,  Next: Z8000 Directives,  Prev: Z8000 Options,  Up: Z8000-Dependent
  1131.  
  1132. Syntax
  1133. ------
  1134.  
  1135. * Menu:
  1136.  
  1137. * Z8000-Chars::                Special Characters
  1138. * Z8000-Regs::                 Register Names
  1139. * Z8000-Addressing::           Addressing Modes
  1140.  
  1141. 
  1142. File: as.info,  Node: Z8000-Chars,  Next: Z8000-Regs,  Up: Z8000 Syntax
  1143.  
  1144. Special Characters
  1145. ..................
  1146.  
  1147.    `!' is the line comment character.
  1148.  
  1149.    You can use `;' instead of a newline to separate statements.
  1150.  
  1151. 
  1152. File: as.info,  Node: Z8000-Regs,  Next: Z8000-Addressing,  Prev: Z8000-Chars,  Up: Z8000 Syntax
  1153.  
  1154. Register Names
  1155. ..............
  1156.  
  1157.    The Z8000 has sixteen 16 bit registers, numbered 0 to 15.  You can
  1158. refer to different sized groups of registers by register number, with
  1159. the prefix `r' for 16 bit registers, `rr' for 32 bit registers and `rq'
  1160. for 64 bit registers.  You can also refer to the contents of the first
  1161. eight (of the sixteen 16 bit registers) by bytes.  They are named `rNh'
  1162. and `rNl'.
  1163.  
  1164. *byte registers*
  1165.      r0l r0h r1h r1l r2h r2l r3h r3l
  1166.      r4h r4l r5h r5l r6h r6l r7h r7l
  1167. *word registers*
  1168.      r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15
  1169. *long word registers*
  1170.      rr0 rr2 rr4 rr6 rr8 rr10 rr12 rr14
  1171. *quad word registers*
  1172.      rq0 rq4 rq8 rq12
  1173.  
  1174. 
  1175. File: as.info,  Node: Z8000-Addressing,  Prev: Z8000-Regs,  Up: Z8000 Syntax
  1176.  
  1177. Addressing Modes
  1178. ................
  1179.  
  1180.    as understands the following addressing modes for the Z8000:
  1181.  
  1182. `rN'
  1183.      Register direct
  1184.  
  1185. `@rN'
  1186.      Indirect register
  1187.  
  1188. `ADDR'
  1189.      Direct: the 16 bit or 24 bit address (depending on whether the
  1190.      assembler is in segmented or unsegmented mode) of the operand is
  1191.      in the instruction.
  1192.  
  1193. `address(rN)'
  1194.      Indexed: the 16 or 24 bit address is added to the 16 bit register
  1195.      to produce the final address in memory of the operand.
  1196.  
  1197. `rN(#IMM)'
  1198.      Base Address: the 16 or 24 bit register is added to the 16 bit sign
  1199.      extended immediate displacement to produce the final address in
  1200.      memory of the operand.
  1201.  
  1202. `rN(rM)'
  1203.      Base Index: the 16 or 24 bit register rN is added to the sign
  1204.      extended 16 bit index register rM to produce the final address in
  1205.      memory of the operand.
  1206.  
  1207. `#XX'
  1208.      Immediate data XX.
  1209.  
  1210. 
  1211. File: as.info,  Node: Z8000 Directives,  Next: Z8000 Opcodes,  Prev: Z8000 Syntax,  Up: Z8000-Dependent
  1212.  
  1213. Assembler Directives for the Z8000
  1214. ----------------------------------
  1215.  
  1216.    The Z8000 port of as includes these additional assembler directives,
  1217. for compatibility with other Z8000 assemblers.  As shown, these do not
  1218. begin with `.' (unlike the ordinary as directives).
  1219.  
  1220. `segm'
  1221.      Generates code for the segmented Z8001.
  1222.  
  1223. `unsegm'
  1224.      Generates code for the unsegmented Z8002.
  1225.  
  1226. `name'
  1227.      Synonym for `.file'
  1228.  
  1229. `global'
  1230.      Synonum for `.global'
  1231.  
  1232. `wval'
  1233.      Synonym for `.word'
  1234.  
  1235. `lval'
  1236.      Synonym for `.long'
  1237.  
  1238. `bval'
  1239.      Synonym for `.byte'
  1240.  
  1241. `sval'
  1242.      Assemble a string.  `sval' expects one string literal, delimited by
  1243.      single quotes.  It assembles each byte of the string into
  1244.      consecutive addresses.  You can use the escape sequence `%XX'
  1245.      (where XX represents a two-digit hexadecimal number) to represent
  1246.      the character whose ASCII value is XX.  Use this feature to
  1247.      describe single quote and other characters that may not appear in
  1248.      string literals as themselves.  For example, the C statement
  1249.      `char *a = "he said \"it's 50% off\"";' is represented in Z8000
  1250.      assembly language (shown with the assembler output in hex at the
  1251.      left) as
  1252.  
  1253.           68652073    sval    'he said %22it%27s 50%25 off%22%00'
  1254.           61696420
  1255.           22697427
  1256.           73203530
  1257.           25206F66
  1258.           662200
  1259.  
  1260. `rsect'
  1261.      synonym for `.section'
  1262.  
  1263. `block'
  1264.      synonym for `.space'
  1265.  
  1266. `even'
  1267.      synonym for `.align 1'
  1268.  
  1269.